#!/bin/bash

############################################################################
#
# 远程执行该脚本，请在命令行中直接执行以下命令：
#
#   curl -sSL https://gitee.com/tay3223/biubiubiu/raw/master/centos7-install-saltstack-master.sh | /bin/bash
#
#
############################################################################


rpm --import https://repo.saltproject.io/salt/py3/redhat/7/x86_64/SALT-PROJECT-GPG-PUBKEY-2023.pub
curl -fsSL https://repo.saltproject.io/salt/py3/redhat/7/x86_64/3006.repo | tee /etc/yum.repos.d/salt.repo


yum install -y \
  salt-master \
  salt-minion \
  salt-ssh \
  salt-syndic \
  salt-cloud \
  salt-api


systemctl enable salt-master && systemctl restart salt-master
systemctl enable salt-minion && systemctl restart salt-minion
systemctl enable salt-syndic && systemctl restart salt-syndic
systemctl enable salt-api && systemctl restart salt-api




cat <<Tay

====================================
1.安装salt-master并设置为开机启动（√ ）
2.安装salt-minion并设置为开机启动（√ ）
3.安装salt-syndic并设置为开机启动（√ ）
4.安装salt-api并设置为开机启动（√ ）
3.相关命令：
    systemctl enable salt-master && systemctl start salt-master
    systemctl enable salt-minion && systemctl start salt-minion
    systemctl enable salt-syndic && systemctl start salt-syndic
    systemctl enable salt-api && systemctl start salt-api

    systemctl status salt-master salt-minion salt-syndic salt-api
====================================

Tay
